//
//  JDLoginModel.swift
//  DragonWallet
//
//  Created by volantPig on 2024/3/7.
//

import UIKit
import HandyJSON

class JDLoginModel: HandyJSON {

    static let `default` = JDLoginModel()
    
    func refreshData(_ model: JDLoginModel) {
        self.mobile = model.mobile
        self.nickname = model.nickname
        self.userId = model.userId
        self.memberLevel = model.memberLevel
//        self.firstSendKanban = model.firstSendKanban
        self.headerImg = model.headerImg
        if (model.token?.count ?? 0) > 0 {
            self.token = model.token
        }
    }
    
    func userLogout() {
        self.mobile = nil
        self.nickname = nil
        self.userId = nil
//        self.firstSendKanban = 0
        self.memberLevel = nil
        self.token = nil
        self.headerImg = nil
    }
    
//    {"mobile":"13284231780","nickname":"手机用户1780","userId":3,"firstSendKanban":1,"token":"29337963cc834b14b9194431a9e4698d"}
    
//    {"mobile":"15041702096","nickname":"手机用户2096","userId":115,"memberLevel":1,"token":"3cd199a3f43f4844b832ab70203981b9"}
    var mobile: String?
    var nickname: String?
    var userId: String?
    /// 会员等级
    var memberLevel: Int?
//    // 1: 是首次发布  0与其他: 不是首次发布
//    /// 是否是第一次发布
//    var firstSendKanban: Int?
    var token: String?
    var headerImg: String?
    
//    /// 用户手机号码  登录时 前端记录
//    var phoneNumber: String?
//    /// 是否是第一次发布
//    var isFirstRelease: Bool = {
//        return true
//    }()
    
    required init() { }
}


